<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function foo(e) {
				console.log(e); // MouseEvent			
				console.log(e.button); // 0 左键  1 中间滑轮 2 右键
				if (e.button == 2) {
					window.location = "https://www.baidu.com";
				}
			}

			// onmousedown 鼠标按下的事件
			document.onmousedown = foo;
		</script>
	</body>
</html>
